<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>forEach方法</title>
</head>

<body>
  <script>
    // forEach()  单纯的遍历数组
    // array.forEach(function (currentValue, index, arr) )遍历数组
    // currentValue：数组当前项的值 也就是数组的每一项
    // index：数组当前项的索引值
    // arr：数组对象本身


    var arr = ['张飞', '刘备', '关羽', '赵云']
    arr.forEach(function (val, index, array) {
      console.log(val, index, array);
    })
  </script>
</body>

</html>